package com.example.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author testjava
 * @since 2022-08-20
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class User implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "uid", type = IdType.AUTO)
    private Integer uid;
    @TableField("loginName")
    private String loginName;
    /**
     * 初始化密码:123456
     */
    private String password;
    private String name;
    private String gender;
    private String phone;
    private String email;
    private String description;
    @TableField("departmentId")
    private Integer departmentId;
    private String image;

    @TableField(exist = false)
    private Department department;
    @TableField(exist = false)
    private List<Role> roles;
    @TableField(exist = false)
    private List<Integer> rolesId;
    @TableField(exist = false)
    private List<String> privilegeNames;
    @TableField(exist = false)
    private List<Integer> privilegeIds;
    @TableField(exist = false)
    private List<Schedule> scheduleList;//日程信息
    @TableField(exist = false)
    private List<Address> addressList;//通讯录
    @TableField(exist = false)
    private List<Attendance> attendanceList;//考勤信息
    @TableField(exist = false)
    private List<Diary> diaryList;//工作日记
    @TableField(exist = false)
    private List<WorkPlan> workPlanList;//工作计划

    public User(String loginName, String name, String gender,
                String phone, String email, String description, Integer departmentId) {
        this.loginName = loginName;
        this.name = name;
        this.gender = gender;
        this.phone = phone;
        this.email = email;
        this.description = description;
        this.departmentId = departmentId;
    }

}
